import React, { Component } from 'react'
import {connect} from 'react-redux'
import {Route,Switch,Redirect} from 'react-router-dom'

//css
import './index.scss'
//组件

import My from './My/index'          //个人中心
import Orderlist from './OrderList/index'        //订单列表
import OrderDetail from './OrderDetail/index'   //订单详情
// import OrderComment from '@pages/My/OrderComment'   //订单评论
// import Helpback from '@/pages/My/Helpback'       //帮助反馈
// import Coupon from '@pages/My/Coupon'          //代金券
// import MyFeedback from '@/pages/My/MyFeedback'   //反馈列表
import MyFavorate from './MyFavorate/myFavorate'   //我的收藏
// import Mypurse from '@pages/My/Mypurse'   //我的钱包
import Integral from './Integral/integral'   //积分
import PointsRank from './PointsRank/index'  //推广大使排行榜
// import PurseDetail from '@pages/My/PurseDetail'   //零钱详情
import Address from './Address/index'  //地址列表
import AddressAdd from './AddressAdd/index'  //新建地址
import AddressEdit from './AddressEdit/index'  //编辑地址
import Logistics from './Logistics/index'  //物流
import ApplyForShare from './ApplyForShare/index' //申请成为推广大使
import NotFound from '../../pages/404/index'



class Mypage extends Component {
    render(){
        return (
            <Switch>
                <Route exact path="/my" component={My}></Route>
                {/*<Route exact path='/my/purse' component={Mypurse}></Route>*/}
                <Route exact path='/my/integral' component={Integral}></Route>
                {/*<Route exact path='/my/pursedetail' component={PurseDetail}></Route>*/}
                <Route exact path='/my/address' component={Address}></Route>
                <Route exact path='/my/addressadd' component={AddressAdd}></Route>
                <Route exact path='/my/addressedit' component={AddressEdit}></Route>
                <Route exact path='/my/logistics' component={Logistics}></Route>
                <Route exact path='/my/orderlist/:name' component={Orderlist}></Route>
                <Route exact path='/my/orderdetail/:orderId' component={OrderDetail}></Route>
                <Route exact path='/my/applyForShare' component={ApplyForShare}></Route>
                <Route exact path='/my/PointsRank' component={PointsRank}></Route>
                {/*<Route exact path='/my/ordercomment/:orderId' component={OrderComment}></Route>*/}
                {/*<Route exact path='/my/helpback' component={Helpback}></Route>*/}
                {/*<Route exact path='/my/coupon' component={Coupon}></Route>*/}
                {/*<Route exact path='/my/feedback' component={MyFeedback}></Route>*/}
                <Route exact path='/my/myFavorate' component={MyFavorate}></Route>
                {/*<Route exact path='/my/community' component={Community}></Route>*/}
                {/*<Route exact path='/my/communitydetail' component={CommunityDetail}></Route>*/}
                {/*<Route exact path='/my/communitycomment' component={CommunityComment}></Route>*/}
                {/*<Route exact path='/my/communityissue' component={CommunityIssue}></Route>*/}
                {/*<Route exact path='/my/school' component={School}></Route>*/}
                {/*<Route exact path='/my/schooldetail/:id' component={SchoolDetail}></Route>*/}
                <Route exact path='/404' component={NotFound}/>
                <Route render={() => <Redirect to="/404" />} />
            </Switch>
        )
    }
}

export default connect()(Mypage)